<%@page language="java" pageEncoding="UTF-8"%>    
<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="java.net.*" %> 
<%@page import="orest.front.achieve.*" %> 
<%@page import="net.ssta.core.db.RecordSet" %> 
<%@page import="net.ssta.core.db.Record" %>
<%@page import="net.ssta.common.LoginUser" %>

<%        
      String path = request.getContextPath();
	  response.setHeader("ContentType","text/xml");  
      response.setHeader("Pragma","No-Cache");   
      response.setDateHeader("Expires",0);   
      response.setHeader("Cache-Control","No-Cache");  
%>

<%  
	//request.setCharacterEncoding("gbk");
	request.setCharacterEncoding("UTF-8");
	
	String userid = LoginUser.getUserId();
	
	String kjcgid = request.getParameter("kjcgid");
        if(kjcgid == null ) kjcgid="";
    //String title = request.getParameter("title");
    //title = new String(title.getBytes("UTF-8"),"GBK");
    
    Record kjcgRecord = AchieveHandler.getKjcgById(kjcgid);
    String title = kjcgRecord.getString("KJCG_ITEM_3","");
    title  = title.trim();
    String enjoytype=""; 
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<head> 
<META http-equiv=x-ua-compatible content=ie=7 />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目信息－国家安科网</title>

<link href="<%=path%>/common/css/layout.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/common/css/user.css" rel="stylesheet" type="text/css" />

   
<script language = "javascript" src = "../common/js/list.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/pool.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/page.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/log.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/message.js" type = "text/javascript"></script>
<script language = "javascript" src = "js/search.js" type = "text/javascript"></script>
<script language = "javascript" src = "js/setcondition.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/mycollection.js" type = "text/javascript"></script>
<script language = "javascript" src = "../common/js/g_variables.js" type = "text/javascript"></script>
<script type='text/javascript' src="<%=path%>/includes/js/jquery.js"></script>


<xml id="resultDom"></xml>


<style>
	
	.cnkiBar{
		font-size:15px;
		color:#990000;
		font-weight:bold;
	}
</style>



</head>

<html>
<body style="text-align:center;">

<%@include file="../common/toplogin.jsp"%>
<%@include file="../common/topbanner.jsp"%>
<%@include file="../common/topmenu.jsp"%>








<!--页面主体部分-->
<div id="contentmain">
    <%@include file="../common/charge/kjcgCharge.jsp" %>
	<div id="" style="width:100%;text-align:left;">
	    <div id="topsearchbox" style="float:left;margin-left:5px;">
		    <form id="searchform" name="searchform" action="<%=path%>/achieve/search_results.jsp" method="post" >
				<ul>
					<li><img src="<%=path%>/common/images/search/icon.gif" /></li>
					<li><span class="bluetitle">关键字</span></li>
					<li>
						<input type="text" name="item_3" id="item_3" size="18" style="margin-top:2px;" />
	                    <input type="hidden" name="topicname" id="topicname" value=""/>
	                 　　	<input type="hidden" name="key" id="key" value=""/>   
					</li>
					<li>
						<a href="javascript:doSearch();">
							<img  src="<%=path%>/common/images/search/botton1.gif" style="border:0px;margin-top:4px;"/>
						</a>
					</li>
					<li>
						<span><a href="<%=path%>/achieve/advancedsearch.jsp" target="_self">高级搜索</a></span>
					</li>
					<li>
						<a href="<%=path%>/achieve/needforachieve.jsp" target="_self">帮您找项目</a>
					</li>
				</ul>
			</form>
		</div>
		<br/>
		<div id="border_box">
		    <div id="ind_title"><font>当前位置：<a href="/cms" class="blue">首页</a> > <a href="<%=path%>/achieve/achieveIndex.jsp" class="blue">科技成果</a> > 正文</font><span></span></div>
			<div id="int_show_con_title" style="text-align:center;"></div>
			<!--  -->
			<div id="int_show_con_info">
			    <span></span>
				<span></span>
				<span></span>
				<span>
				</span>
			</div>
			
			<div id="int_show_con_content">
				<span id="zoom">
					   <div id="progressbar" class="bar_progress">数据加载中,请稍候......</div>
					   <div id="showkjcginfo">
							<div id="showunitinfo"></div>	
			              	<div id="collect"></div> 												
				       </div>
				</span>
			</div>
			
			
			<div style="text-align:center;margin-top:30px;padding-bottom:20px;">
			   		<%if(userid!=null && userid!=""){//只有用户登录后才能显示收藏按钮%>
						<span onClick="javascript:_addCollection();"><img src="<%=path%>/common/images/intshow/botton4.gif" border="0" style="cursor:hand;" /></span>&nbsp;
			        <%}%>
			</div>
			
		</div>
	</div>
</div>







<table width="100%" cellpadding="0" cellspacing="0" border="0" style="text-align:center;margin-top:20px;" align="center">
	<tr>
		<td style="width:20%"></td>
		<td align="left">
			<div style="width:971px;text-align:left;">
				<!--相关成果-->
				<div id="cnkiDiv1" style="text-align:left;"></div>
				
				<!---->
				<div id="cnkiDiv2" style="width:100%;text-align:left;margin-left:0px;padding-left:0px;"></div>
				
				<!--相关成果、标准、专利-->
				<div id="cnkiDiv3" style="text-align:left;"></div>
				
				<!--相关文献-->
				<div id="cnkiDiv4" style="text-align:left;"></div>
			</div>
		</td>
		<td style="width:20%;"></td>
	</tr>
</table>



			       
<!-- 同方知网 -->

<%@include file="../common/bottom.jsp"%>

<form name="collectionform" id="collectionform">
<cms:infobase>
	<input type="hidden" name="channelid" id="channelid" value="11" />
    <input type="hidden" name="channelname" id="channelname" value="科技成果" />
    <input type="hidden" name="infotitle" id="infotitle" value="" />
    <input type="hidden" name="infoid" id="infoid" value="<%=kjcgid%>" />
    <input type="hidden" name="collectionurl" id="collectionurl" value="" />
</cms:infobase>    
</form>


</body>
</html>

<script>

    var enjoytype = "<%=enjoytype%>"  
    
    function doZoom(size)
	{
		document.getElementById('zoom').style.fontSize=size+'px';
	}
	
	
	
	var title = "";
	
	
	//查看完整信息
	function viewCompInfo(kjcgid){
		window.open("<%=path%>/achieve/report.jsp?kjcgid="+$.trim(kjcgid));
	}
	
	
		
	//查看科技成果
	function viewKjcg(kjcgid,kjcgname){
		window.open("<%=path%>/achieve/info.jsp?kjcgid="+$.trim(kjcgid)+"&title="+$.trim(kjcgname));
	}

	//推荐科技成果
	function load_tjkjcg(divid,http){
		$.ajax({
			type:"POST",
			url:http,
			error:function(msg)
			{
				//alert("操作失败，请重试！"+msg);
			},
		    success:function(data)
		    {
		    	var data = eval("("+data+")");
		    	//alert(data);
				var html="";
				var showcount = 10;
				var i=0;
				for(i=0;i<data.length&&i<showcount;i++){
					var kjcgname = data[i]['kjcgname'];
					html+="<li>";
					html+="<a href='#2012' style=\"width:100%\" onclick=\"viewKjcg('"+data[i]['kjcgid']+"')\">·"+kjcgname.substring(0,20)+"</a></li>";
					//html+="<span>";
					//html+=data[i]['unitname'].substring(0,8);
					//html+="</span>";
				}
				for(var j=i;j<showcount;j++){
					html+="<li><a style=\"width:100%\" href=\"#\">·</a></li>";
				}
				$("#"+divid).html(html);
			}
		});
	}
	
	
	/* delete left space */
	function ltrim(s){
	    return s.replace( /^\s*/, ""); 
	}
	
	/* delete right space */
	function rtrim(s){
	    return s.replace( /\s*$/, "");
	}
	
	/* delete all space */
	function trim(s){
	    return rtrim(ltrim(s));
	}
	
	
	function loadCnkiInfo(){
			//var cnkihttp = new ActiveXObject("Microsoft.XMLHTTP");
			var name = '<%=title%>';
			//name = "绿色饲料添加剂";
			//alert(name);
			 //name="";
            //name = encodeURI(name);//如果web服务器配的URIEncoding为utf-8,则加这句 本地需要加 twns服务器不要加
            
            var res1 = "";
            
            $.ajax({
					type: "POST", 
					url: "<%=path%>/achieve/agent/getCNKIJSON.jsp",
					data:"title="+name,
					error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
					success: function(msg){
					 		//msg=msg.replace(new RegExp("\r\n", 'g'), "");
					 		while(msg.charAt(0)=="\r"||msg.charAt(0)=="\n"){
					 			msg = msg.substring(1,msg.length); 
					 		}
            				msg=msg.replace(new RegExp("    <", 'g'), "<");
						    res1 = msg;
							 
				            
				            var cnkixml = null;
				            var isIE=1;
				           
				            try//Internet Explorer
							  {
								  cnkixml=new ActiveXObject("Microsoft.XMLDOM");
								  cnkixml.async="false";
								  cnkixml.loadXML(res1);
							  }
							catch(e)
							  {
								  try //Firefox, Mozilla, Opera, etc.
								  {
								  		isIE=0;
									    parser = new DOMParser();
									    cnkixml = parser.parseFromString(res1,"text/xml");
								  } catch(e) {alert(e.message)}
							  }
				            
				            
				            
				            
				            
				           	if(cnkixml==null){
				           		return;
				           	}
				            var cnkiinfoNodeList = cnkixml.getElementsByTagName("param");
				            
				            var huo="text"
				            
				            if(isIE==0){
				           		 huo="textContent"
				            }
				            var cnkiinfo1 = "";
				            var cnkiinfo2 = "";
				            var cnkiinfo3 = "";
				            var cnkiinfo4 = "";
				            var cnkiinfo5 = "";
				            var cnkiinfo6 = "";
				            var cnkiinfo7 = "";
				            if(cnkiinfoNodeList.length > 0) {
				            	//完成单位发表文献 
				                cnkiinfo1 = "DBName="+cnkiinfoNodeList.item(0).childNodes.item(0)[huo];
				                cnkiinfo1 += "&RunID="+cnkiinfoNodeList.item(0).childNodes.item(1)[huo];
				                cnkiinfo1 += "&RunName="+cnkiinfoNodeList.item(0).childNodes.item(2)[huo];
				                cnkiinfo1 += "&RunParam="+cnkiinfoNodeList.item(0).childNodes.item(3)[huo];
				                //成果完成人发表文献   
				                cnkiinfo2 = "DBName="+cnkiinfoNodeList.item(1).childNodes.item(0)[huo];
				                cnkiinfo2 += "&RunID="+cnkiinfoNodeList.item(1).childNodes.item(1)[huo];
				                cnkiinfo2 += "&RunName="+cnkiinfoNodeList.item(1).childNodes.item(2)[huo];
				                cnkiinfo2 += "&RunParam="+cnkiinfoNodeList.item(1).childNodes.item(3)[huo];
				                //所涉核心技术研究动态  
				                cnkiinfo3 = "DBName="+cnkiinfoNodeList.item(2).childNodes.item(0)[huo];
				                cnkiinfo3 += "&RunID="+cnkiinfoNodeList.item(2).childNodes.item(1)[huo];
				                cnkiinfo3 += "&RunName="+cnkiinfoNodeList.item(2).childNodes.item(2)[huo];
				                cnkiinfo3 += "&RunParam="+cnkiinfoNodeList.item(2).childNodes.item(3)[huo];
				                //成果产出状态分析 DBName=SNAD;RunID=SNAD_CCZTFX;RunName
				                cnkiinfo4 = "DBName="+cnkiinfoNodeList.item(3).childNodes.item(0)[huo];
				                cnkiinfo4 += "&RunID="+cnkiinfoNodeList.item(3).childNodes.item(1)[huo];
				                cnkiinfo4 += "&RunName="+cnkiinfoNodeList.item(3).childNodes.item(2)[huo];
				                cnkiinfo4 += "&RunParam="+cnkiinfoNodeList.item(3).childNodes.item(3)[huo];
				                
				                //本领域专利与标准
				          		cnkiinfo5 = "DBName="+cnkiinfoNodeList.item(4).childNodes.item(0)[huo];
				                cnkiinfo5 += "&RunID="+cnkiinfoNodeList.item(4).childNodes.item(1)[huo];
				                cnkiinfo5 += "&RunName="+cnkiinfoNodeList.item(4).childNodes.item(2)[huo];
				                cnkiinfo5 += "&RunParam="+cnkiinfoNodeList.item(4).childNodes.item(3)[huo];
				                
				                // 本成果研究背景 
				                cnkiinfo6 = "DBName="+cnkiinfoNodeList.item(5).childNodes.item(0)[huo];
				                cnkiinfo6 += "&RunID="+cnkiinfoNodeList.item(5).childNodes.item(1)[huo];
				                cnkiinfo6 += "&RunName="+cnkiinfoNodeList.item(5).childNodes.item(2)[huo];
				                cnkiinfo6 += "&RunParam="+cnkiinfoNodeList.item(5).childNodes.item(3)[huo];
				                //本成果应用动态
				                cnkiinfo7 = "DBName="+cnkiinfoNodeList.item(6).childNodes.item(0)[huo];
				                cnkiinfo7 += "&RunID="+cnkiinfoNodeList.item(6).childNodes.item(1)[huo];
				                cnkiinfo7 += "&RunName="+cnkiinfoNodeList.item(6).childNodes.item(2)[huo];
				                cnkiinfo7 += "&RunParam="+cnkiinfoNodeList.item(6).childNodes.item(3)[huo];
				            }
				            
				            
				            
				            cnkiinfo4 = encodeURI(cnkiinfo4);
				            $.ajax({
									type: "POST", url: "<%=path%>/achieve/agent/getCNKIInfo.jsp",
									data:cnkiinfo4,
									error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
									success: function(msg){
										if(msg!=null&&trim(msg)!=""){
											$("#cnkiDiv1").html('<div class="cnkiBar" style=\"\">研发单位</div>'+msg);
			           		        	}
			           		        }
							});
				            
						    
						    
						    
						    cnkiinfo1 = encodeURI(cnkiinfo1);
						    $.ajax({
									type: "POST", url: "<%=path%>/achieve/agent/getCNKIInfo.jsp",
									data:cnkiinfo1,
									error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
									success: function(msg){
										if(msg!=null&&trim(msg)!=""){
											//msg = msg.replaceAll("更多&gt;&gt;", "<br/>");
											
											msg = replace_a(msg,"更多&gt;&gt;","<br/>");
											
											$("#cnkiDiv2").html(msg);
			           		        	}
			           		        }
							});
						    
						    
						    
						    //相关成果、标准、专利
						    cnkiinfo5 = encodeURI(cnkiinfo5);
						    $.ajax({
									type: "POST", url: "<%=path%>/achieve/agent/getCNKIInfo.jsp",
									data:cnkiinfo5,
									error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
									success: function(msg){
										if(msg!=null&&trim(msg)!=""){
											$("#cnkiDiv3").html('<div class="cnkiBar" style=\"\">相关成果、标准、专利</div>'+msg);
			           		        	}
			           		        }
							});
						    
						    
						    
				            
						    //相关文献
						    cnkiinfo6 = encodeURI(cnkiinfo6);
						    cnkiinfo7 = encodeURI(cnkiinfo7);
						    
						    /*var cnkihttp4 = new ActiveXObject("Microsoft.XMLHTTP");
				            cnkihttp4.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo6, false);
				            cnkihttp4.send();
				            
				            var cnkihttp7 = new ActiveXObject("Microsoft.XMLHTTP");
				            cnkihttp7.open("POST", "<%=path%>/achieve/agent/getCNKIInfo.jsp?"+cnkiinfo7, false);
				            cnkihttp7.send();*/
						    
						    
						    
						    //相关文献
						    cnkiinfo3 = encodeURI(cnkiinfo3);
						    $.ajax({
									type: "POST", url: "<%=path%>/achieve/agent/getCNKIInfo.jsp",
									data:cnkiinfo3,
									error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
									success: function(msg){
										if(msg!=null&&trim(msg)!=""){
											$("#cnkiDiv4").html('<div class="cnkiBar" style=\"\">相关文献</div>'+msg);
			           		        	}
			           		        }
							});

					}
			});
            
	}
	
	
	
	
    
    
    $("document").ready(function()
	{
		 columnid ="001";
         columninfoid = "<%=kjcgid%>";
         columninfoname = "<%=title%>";
		 var kjcgid = "<%=kjcgid%>";
         sendLog("001","项目信息",kjcgid,title);
         var url = "http://" + location.host + "/SSTA/achieve/agent/getKjcgInfo.jsp?kjcgid=<%=kjcgid%>&jtime=" + (new Date()).getTime();       
         XmlHttpPool.GetRemoteData(url,showKjcgInfo);
         
         
         //加载推荐科技成果
		 var http = "<%=path%>/front/AchieveServlet?method=getRecommendKjcgList&showType=HomepageShow";
		 //load_tjkjcg("zylist",http);
         
         
         
         var isIE = null;
         
          try //Internet Explorer
		  {
			  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
			  isIE = "1";//1表示是IE
		  }catch(e){
			  isIE = "0";
		  }
         
         
		 //连接同方知网
		 if(isIE == "1"){
		 	loadCnkiInfo();
		 }else{
		 	loadCnkiInfo();
		 }
		 
	}); 
	
	
	function _addCollection(){
		document.getElementById("collectionurl").value=window.location.href;
		 $.ajax({
				type: "POST", url: "<%=path%>/membercenter/collection?method=addCollection",
				data:$("#collectionform").serialize(),
				error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
				success: function(msg){
					alert("收藏操作成功!");
				}
			 });
	}
</script>